import axios from 'axios'
import storage from 'store'
import { ACCESS_TOKEN } from '@/store/mutation-types'

// 上傳
export function _upload (formData) {
  const request = axios.create({
    // API 请求的默认前缀
    baseURL: process.env.VUE_APP_API_BASE_URL,
    headers: {
      'Authorization': 'Bearer ' + storage.get(ACCESS_TOKEN)
    },
    timeout: 6000 // 请求超时时间
  })
    return request({
        url: '/filestore/upload',
        method: 'post',
        data: formData
    })
}
